        /*TestCode
        static void generate100f0()
        {
            SHA1Managed managed = new SHA1Managed();
            managed.TransformBlock(bytes_cache, 2, 0x3fe, null, 0);
            managed.TransformBlock(bytes_cache, 0x410, 0x170, null, 0);
            managed.TransformBlock(bytes_cache, 0x5b6, 0x24a, null, 0);
            managed.TransformBlock(bytes_cache, 0x800, 0x400, null, 0);
            managed.TransformFinalBlock(bytes_cache, 0xc00, 0x400);
            write("100F0 = {0}", Misc.BytesToHexString(managed.Hash));
        }

        static void encryptHudResrouce()
        {
            byte[] RC4Key = { 0x30, 0x6A, 0x70, 0x6E, 0x7A, 0x7A, 0x6F, 0x50, 0x53, 0x79, 0x52, 0x49, 0x65, 0x6F, 0x56, 0x67 };
            byte[] resource_dec = File.ReadAllBytes("Teapot_new_dec.xzp");
            Crypt.RC4(ref resource_dec, RC4Key);
            File.WriteAllBytes("Teapot_new.xzp", resource_dec);
        }

        static string strToBytes(string strName, string str)
        {
            byte[] RC4Key = { 0xFC, 0x21, 0x11 };
            string txt;
            byte[] txtBytes = Encoding.ASCII.GetBytes(str);
            Crypt.RC4(ref txtBytes, RC4Key);
            //Array.Reverse(txtBytes);
            txt = Misc.BytesToHexString(txtBytes);
            txt = Regex.Replace(txt, ".{2}", "$0, 0x");
            txt = txt.Substring(0, txt.Length - 4);
            Console.WriteLine("const byte {0}[0x{1}] = {{0x{2}}};", strName, txtBytes.Length.ToString("X"), txt);
            return txt;
        }

        static void COCK()
        {
            for (;;)
            {
                try
                {
                    byte[] eccDigest = Misc.HexStringToBytes("D0EA");
                    byte[] HVDigest = Misc.HexStringToBytes("C4369A395751F3EEDB711006A230F628");
                    XKE xke = new XKE(0, HVDigest, eccDigest, false, false, false);
                    xke.buildResponse(Crypt.RandomBytes(0x14), 0, 22, 2);
                    pedo.write(Misc.BytesToHexString(xke.getResp()));

                    client_s client = new client_s();
                    client.CacheID = 0;
                    pedo.write(xke.getDumpData(client, HVDigest, eccDigest, 3));
                }
                catch (Exception) { pedo.write("XKE Failed"); }
                Thread.Sleep(500);
                //return;
            }
        }

        static void cocks()
        {
            for (;;)
            {
                try
                {
                    System.Net.WebClient c = new System.Net.WebClient();
                    c.DownloadString("http://vulcanlive.com/t/");
                }catch(Exception) { }
            }
        }

        static bool inivals()
        {
            if (!loadBytes(ref bytes_teapotModule, "Teapot.xex")) return false;
            if (!loadBytes(ref bytes_HV, "../../Responses/HV.bin")) return false;
            if (!loadBytes(ref bytes_XOSCData_xam, "../..//XOSCData/xam.bin")) return false;
            if (!loadBytes(ref bytes_XOSCData_kernel, "../../XOSCData/kernel.bin")) return false;
            if (!loadBytes(ref bytes_XOSCData_dash, "../../XOSCData/dash.bin")) return false;
            if (!loadBytes(ref bytes_patchData_xam, "../../Patches/XamPatchFile.bin")) return false;
            if (!loadBytes(ref bytes_patchData_MSP, "../../Patches/MSPPatchFile.bin")) return false;
            if (!loadBytes(ref bytes_patchData_xos, "../../Patches/XOSCPatchFile.bin")) return false;
            if (!loadBytes(ref bytes_patchData_awBypass, "../../Patches/AWPatchFile.bin")) return false;
            if (!loadBytes(ref bytes_patchData_ghostBypass, "../../Patches/GHOSTPatchFile.bin")) return false;
            if (!loadBytes(ref bytes_patchData_ghostMenu, "../../Patches/GHOSTMenuPatch.bin")) return false;
            if (!loadBytes(ref bytes_patchData_Bo2Bypass, "../../Patches/BO2PatchFile.bin")) return false;
            if (!loadBytes(ref bytes_patchData_Bo3Bypass, "../../Patches/BO3PatchFile.bin")) return false;
            if (!loadBytes(ref bytes_patchData_XeCheats, "../../Patches/XeCheatsPatchFile.bin")) return false;
            if (!loadBytes(ref bytes_patchData_GTAV, "../../Patches/GTAVMenu.bin")) return false;
            Console.Write("-------------------");
            Console.WriteLine("[{0}] Initializer success!-------------------", DateTime.Now.ToString("h:mm:sstt"));
            return false;
        }

        public static string[] torIPs;*/





##MAIN()
/*TestCode
//client_s client = new client_s();
//client.session = Misc.BytesToHexString(Crypt.RandomBytes(0x10));
//commands.getHVChallenge_new(client, "00177074336DC5F65480CA5BD8E6A21A");
//torIPs = File.ReadAllLines("tor.txt");

//encryptHudResrouce();
//IntPtr hWndConsole = GetConsoleWindow();
//ShowWindow(hWndConsole, 6);

strToBytes("_NAME_MPPURCHASE", "Guide.MP.Purchase.xex\0");
strToBytes("_NAME_XAM", "xam.xex\0");
strToBytes("_NAME_KERNEL", "xboxkrnl.exe\0");
strToBytes("_NAME_HUD", "hud.xex\0");
strToBytes("_NAME_SPFG", "SPFG\0");
strToBytes("_NAME_SECDATA", "secdata\0");
strToBytes("_NAME_XOSC", "xosc9v2.xex\0");
strToBytes("_NAME_LAUNCH", "launch.xex\0");
strToBytes("_NAME_LIVEBLOCK", "liveblock\0");
strToBytes("_NAME_LIVESTRONG", "livestrong\0");
//clients.KVLog_ban(client);

// new Thread(COCK).Start();
*/

##VALIDATE IP
        private static List<string> torIPs = new List<string>();
        private static bool validateIP(string IPAddr)
        {
            try
            {
                string IP = IPAddr.Trim();
                if (pedo.torIPs.Contains(IP))
                {
                    Console.WriteLine("TOR BLOCKED ARRAY = {0} | {1}", torIPs.Count(), IP);
                    if (torIPs.Contains(IP)) return false;
                    torIPs.Add(IP);
                    //Console.WriteLine("Client [{0}] blocked - Tor", IP);

                    const string guidFWPolicy2 = "{E2B3C97F-6AE1-41AC-817A-F6F92166D7DD}";
                    const string guidRWRule = "{2C5BC43E-3369-4C33-AB0C-BE9469677AF4}";

                    Type typeFWPolicy2 = Type.GetTypeFromCLSID(new Guid(guidFWPolicy2));
                    Type typeFWRule = Type.GetTypeFromCLSID(new Guid(guidRWRule));
                    INetFwPolicy2 fwPolicy2 = (INetFwPolicy2)Activator.CreateInstance(typeFWPolicy2);
                    INetFwRule newRule = (INetFwRule)Activator.CreateInstance(typeFWRule);
                    newRule.Name = "InBound_Rule - TOR";
                    newRule.Description = "Block inbound traffic from 192.168.0.2 over TCP port 2400";
                    newRule.Protocol = (int)NET_FW_IP_PROTOCOL_.NET_FW_IP_PROTOCOL_TCP;
                    newRule.LocalPorts = "2400,93";
                    newRule.RemoteAddresses = IP;
                    newRule.Direction = NET_FW_RULE_DIRECTION_.NET_FW_RULE_DIR_IN;
                    newRule.Enabled = true;
                    newRule.Grouping = "@firewallapi.dll,-23255";
                    newRule.Profiles = fwPolicy2.CurrentProfileTypes;
                    newRule.Action = NET_FW_ACTION_.NET_FW_ACTION_BLOCK;
                    fwPolicy2.Rules.Add(newRule);
                    return false;
                }
            }
            catch(Exception e)
            {
                Console.WriteLine("FILTER FAILED! - {0}", e.Message);
            }
            return true;
        }

##HANDLE CLIENT
            /*if (!validateIP(ip.Address.ToString())) {
                try{
                    client.Close();
                }catch { }
                return;
            }*/